<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
<LINK REL="Start" HREF="index.html">
<LINK REL="Contents" HREF="toc.html">
<LINK REL="Prev" HREF="919Rotatingthegraphs.html">
<LINK REL="Next" HREF="921Timingthegenerationofgraphs.html">
<STYLE TYPE="text/css"><!--
BODY { font-family: serif }
H1 { font-family: sans-serif }
H2 { font-family: sans-serif }
H3 { font-family: sans-serif }
H4 { font-family: sans-serif }
H5 { font-family: sans-serif }
H6 { font-family: sans-serif }
SUB { font-size: smaller }
SUP { font-size: smaller }
PRE { font-family: monospace }
A { text-decoration: none }
--></STYLE>
</HEAD>
<BODY>
<A HREF="toc.html">Contents</A>
<A HREF="919Rotatingthegraphs.html">Previous</A>
<A HREF="921Timingthegenerationofgraphs.html">Next</A>
<HR NOSHADE>
<H2><A NAME="9_20">9.20 Adjusting brightness and contrast for images and
 backgrounds</A></H2>
<P><STRONG> The following section only applies to palette images. This
 means it wont work on true-color images.</STRONG></P>
<P> It is often desirable to have a background image look a little bit
 &quot;washed&quot; out so it doesn't take the concentration away from the actual
 graph. There are basically two ways of accomplish this</P>
<OL>
<LI> Prepare the image with an external images editor to adjust the
 level of brightness and contrasty to a desirable level</LI>
<LI> Use JpGraph:s built in adjustment for contrast, brightness and
 color saturation.</LI>
</OL>
<P> To adjust the background image call The levels for both brightness
 and contrast are real numbers in the range [-1, 1] You can choose to
 adjust for example just the background image or you might also choose
 to adjust the whole image. To change the background image just use the
 method <A href="../ref/Graph.html#_GRAPH_ADJBACKGROUNDIMAGE">
 Graph::AdjBackgroundImage()</A> to specify a suitable value. Let's show
 some example on what we can do with this. The following example have
 been generated by using the small utility &quot;adjimg.php&quot; which you can
 find in the &quot;utils/&quot; directory.</P>
<P> <IMG alt="" border="0" HEIGHT="244"       src="img/img/img/img/img/img/imgadj_orig.jpg" WIDTH="246">
<BR> Brightness=0, contrast=0, saturation = -1 (Original image)</P>
<P> <IMG alt="" border="0" HEIGHT="244"       src="img/img/img/img/img/img/imgadj_b00c00sat-1.jpg" WIDTH="246">
<BR> Brightness=0, contrast=0, saturation = -1 (Black &amp; White image)</P>
<P> <IMG alt="" border="0" HEIGHT="244"       src="img/img/img/img/img/img/imgadj_b03c-03sat0.jpg" WIDTH="246">
<BR> Brightness=0.3, contrast=-0.3, saturation=0</P>
<P> <IMG alt="" border="0" HEIGHT="244"       src="img/img/img/img/img/img/imgadj_b04c-07sat0.jpg" WIDTH="246">
<BR> Brightness=0.4, contrast=-0.7, saturation=0</P>
<P> <IMG alt="" border="0" HEIGHT="244"       src="img/img/img/img/img/img/imgadj_b04c-07sat-1.jpg" WIDTH="246">
<BR> Brightness=0.4, contrast=-0.7, saturation=-1</P>
<P> <IMG alt="" border="0" HEIGHT="244"       src="img/img/img/img/img/img/imgadj_b0c0sat1.jpg" WIDTH="246">
<BR> Brightness=0, contrast=0, saturation=1</P>
<HR NOSHADE>
<A HREF="toc.html">Contents</A>
<A HREF="919Rotatingthegraphs.html">Previous</A>
<A HREF="921Timingthegenerationofgraphs.html">Next</A>
</BODY>
</HTML>
